from random import randint

test_list=[randint(1,100) for i in range(10)]
# print(len(test_list))
def bubble_sort(test:list):
    """
    利用相邻两个元素之间的相互比较完成对排序，换个角度来看，是以2为单位的window的连续逐步移动来完成排序
    :param test:
    :return:
    """
    for i in range(len(test),0,-1):
        for j in range(i-1):
            if test[j+1]<test[j]:
                test[j+1],test[j]=test[j],test[j+1]
    return  test

print(test_list)
print(bubble_sort(test_list))
